#define _CRT_SECURE_NO_DEPRECATE 1

#pragma warning(disable:4996)

#include "List.h"

void TestList1()
{
	LTNode* plist = ListInit();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPopBack(plist);
	ListPushBack(plist, 4);

	ListPrint(plist);
}

void TestList2()
{
	LTNode* plist = ListInit();
	ListPushFront(plist, 1);
	ListPushFront(plist, 2);
	ListPushFront(plist, 3);
	ListPushBack(plist, 4);
	ListPopBack(plist);
	ListPushFront(plist, 4);

	ListPrint(plist);
}

void TestList3()
{
	LTNode* plist = ListInit();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPrint(plist);

	LTNode* pos = FindListNode(plist, 2);
	if (pos)
	{
		ListErase(pos);
	}
	ListPrint(plist);

}

void TestList4()
{
	LTNode* plist = ListInit();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPrint(plist);
	printf("%d", LTSize(plist));
}

void TestList5()
{
	LTNode* plist = ListInit();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPrint(plist);
	//printf("%d\n", LTEmpty(plist));
	ListPrint(plist);

}

int main()
{
	/*TestList1();
	TestList2();
	TestList3();
	TestList4();*/
	TestList5();
	return 0;
}